using System;
using System.Collections.Generic;
using System.ByteBuffer;
using tools;

namespace Shop
{
    /// <summary>
    /// generate by msg tool
    /// 商城物品
    /// </summary>
	public class ResShopItemsMsg : ResMessage
	{
		//物品
		public List<ItemInfo> items = new List<ItemInfo>();
		

        
		public void write(object obj)
		{
            ByteBuffer b = obj as ByteBuffer;
			b.PushInt(items.Count);

			foreach (var element in items)
			{
				element.write(b);
			}
			
		}

	    public void read(object obj)
		{
            MyConverter b = obj as MyConverter;
			int items_length = b.toInt32();
			for (int i = 0; i < items_length; ++i)
			{
				var dto = new ItemInfo();
				dto.read(b);
				items.Add(dto);
			}
			
		}

		public int Id
		{
            get { return 105201; }
		}

        public String Desc
        {
            get { return "商城物品"; }
        }
	}
}